package com.wc.codeforces.数学.约数.Brightness_Begins;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/10/3 22:06
 * @description https://codeforces.com/problemset/problem/2020/B
 */
public class Main {
    /**
     * 思路：
     * 约束，一个数的约数，除了平方数，都是偶数个
     * 灯的亮还是灭, 是由于约数决定的
     * 平方数是灭的, 非平方数是亮的
     * 那么就要看k中有多少个平方数,加上, 如果又多出了平方数, 那就在p++, res++就好了
     * 那么给定k
     * 先找到小于等于他的最小平方数 下取整p = sqrt(k)
     * res = k + p, p++
     * while(p * p <= k) {
     *     p++
     *     res ++
     * }
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static long k;

    public static void main(String[] args) {
        int T = sc.nextInt();
        while (T-- > 0) {
            k = sc.nextLong();
            long res = k;
            long p = (long) Math.sqrt(res);
            res += p;
            p++;
            while (p * p <= res) {
                p++;
                res++;
            }
            out.println(res);
        }
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
